package cn.lsh.spark.sql;

import org.apache.spark.sql.api.java.UDF1;

public class StrLenUdf implements UDF1<String, Integer> {

	private static final long serialVersionUID = -3067426587589292761L;

	@Override
	public Integer call(String o) throws Exception {
		if (o == null || "".equals(o)) {
			return 0;
		}
		return o.length();
	}
}
